import React, { Component } from "react";
import styles from "./index.module.less";
import ChatList from "./chatList";
import ChatDetail from "./chatDetail.js";
import DragView from "./DragView";

class Chat extends Component {
  constructor(props){
    super(props);
    this.state={
      groupname:'',
      begintime:'',
    }
  }
  setGroupname = ({groupname,begintime}) => {
    this.setState({groupname,begintime})
  }
  render() {
    const { chatgroupid, bannerTips } = this.props;
    const { groupname, begintime } = this.state;
    return (
      <div className={styles.App}>
        <div className={styles.leftBar}>
          <ChatList chatgroupid={chatgroupid} setGroupname={this.setGroupname} />
        </div>
        <DragView style={styles.rightContent} groupname={groupname} begintime={begintime}>
          <ChatDetail bannerTips={bannerTips} />
        </DragView>
      </div>
    );
  }
}

export default Chat;
